package edu.stthomas.seis752.model;

// default package
// Generated Apr 11, 2013 1:36:19 AM by Hibernate Tools 3.4.0.CR1


import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * User generated by hbm2java
 */
@Entity
@Table(name="user"
    ,catalog="jibster"
)
public class User  implements java.io.Serializable {

     /**
	 * 
	 */
	private static final long serialVersionUID = -6703393929268422717L;
	private Long id;
     private Media profilePicture;
     private Address address;
     private Location favoriteLocation;
     private String firstName;
     private String middleName;
     private String lastName;
     private String userName;
     private Integer age;
     private String password;
     private Date createDate;
     private Set<MediaTag> mediaTagsForTagUserId = new HashSet<MediaTag>(0);
     private Set<Member> members = new HashSet<Member>(0);
     private Set<MediaTag> mediaTagsForUserId = new HashSet<MediaTag>(0);
     private Set<WallTag> wallTagsForDestUserId = new HashSet<WallTag>(0);
     private Set<WallTag> wallTagsForSrcUserId = new HashSet<WallTag>(0);
     private Set<Media> medias = new HashSet<Media>(0);

    public User() {
    }

	
    public User(String userName, String password, Date createDate) {
        this.userName = userName;
        this.password = password;
        this.createDate = createDate;
    }
    public User(Media profilePicture, Address address, Location favoriteLocation, String firstName, String middleName, String lastName, String userName, Integer age, String password, Date createDate, Set<MediaTag> mediaTagsForTagUserId, Set<Member> members, Set<MediaTag> mediaTagsForUserId, Set<WallTag> wallTagsForDestUserId, Set<WallTag> wallTagsForSrcUserId, Set<Media> medias) {
       this.profilePicture = profilePicture;
       this.address = address;
       this.favoriteLocation = favoriteLocation;
       this.firstName = firstName;
       this.middleName = middleName;
       this.lastName = lastName;
       this.userName = userName;
       this.age = age;
       this.password = password;
       this.createDate = createDate;
       this.mediaTagsForTagUserId = mediaTagsForTagUserId;
       this.members = members;
       this.mediaTagsForUserId = mediaTagsForUserId;
       this.wallTagsForDestUserId = wallTagsForDestUserId;
       this.wallTagsForSrcUserId = wallTagsForSrcUserId;
       this.medias = medias;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)

    
    @Column(name="id", unique=true, nullable=false)
    public Long getId() {
        return this.id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="profile_picture_id")
    public Media getProfilePicture() {
        return this.profilePicture;
    }
    
    public void setProfilePicture(Media profilePicture) {
        this.profilePicture = profilePicture;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="home_address_id")
    public Address getAddress() {
        return this.address;
    }
    
    public void setAddress(Address address) {
        this.address = address;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="main_location_id")
    public Location getFavoriteLocation() {
        return this.favoriteLocation;
    }
    
    public void setFavoriteLocation(Location favoriteLocation) {
        this.favoriteLocation = favoriteLocation;
    }

    
    @Column(name="first_name", length=30)
    public String getFirstName() {
        return this.firstName;
    }
    
    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    
    @Column(name="middle_name", length=30)
    public String getMiddleName() {
        return this.middleName;
    }
    
    public void setMiddleName(String middleName) {
        this.middleName = middleName;
    }

    
    @Column(name="last_name", length=30)
    public String getLastName() {
        return this.lastName;
    }
    
    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    
    @Column(name="user_name", nullable=false, length=30)
    public String getUserName() {
        return this.userName;
    }
    
    public void setUserName(String userName) {
        this.userName = userName;
    }

    
    @Column(name="age")
    public Integer getAge() {
        return this.age;
    }
    
    public void setAge(Integer age) {
        this.age = age;
    }

    
    @Column(name="password", nullable=false, length=30)
    public String getPassword() {
        return this.password;
    }
    
    public void setPassword(String password) {
        this.password = password;
    }

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="create_date", nullable=false, length=0)
    public Date getCreateDate() {
        return this.createDate;
    }
    
    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="userByTagUserId")
    public Set<MediaTag> getMediaTagsForTagUserId() {
        return this.mediaTagsForTagUserId;
    }
    
    public void setMediaTagsForTagUserId(Set<MediaTag> mediaTagsForTagUserId) {
        this.mediaTagsForTagUserId = mediaTagsForTagUserId;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="user")
    public Set<Member> getMembers() {
        return this.members;
    }
    
    public void setMembers(Set<Member> members) {
        this.members = members;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="userByUserId")
    public Set<MediaTag> getMediaTagsForUserId() {
        return this.mediaTagsForUserId;
    }
    
    public void setMediaTagsForUserId(Set<MediaTag> mediaTagsForUserId) {
        this.mediaTagsForUserId = mediaTagsForUserId;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="userByDestUserId")
    public Set<WallTag> getWallTagsForDestUserId() {
        return this.wallTagsForDestUserId;
    }
    
    public void setWallTagsForDestUserId(Set<WallTag> wallTagsForDestUserId) {
        this.wallTagsForDestUserId = wallTagsForDestUserId;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="userBySrcUserId")
    public Set<WallTag> getWallTagsForSrcUserId() {
        return this.wallTagsForSrcUserId;
    }
    
    public void setWallTagsForSrcUserId(Set<WallTag> wallTagsForSrcUserId) {
        this.wallTagsForSrcUserId = wallTagsForSrcUserId;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="user")
    public Set<Media> getMedias() {
        return this.medias;
    }
    
    public void setMedias(Set<Media> medias) {
        this.medias = medias;
    }




}


